//
//  SAIndexActivityCell.m
//  YunFu
//
//  Created by Bager on 2018/9/10.
//  Copyright © 2018年 yunfu. All rights reserved.
//

#import "SAIndexActivityCell.h"

@implementation SAIndexActivityCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setViews];
    }
    return self;
}

- (void)setViews
{
    [self addSubview:self.line];
    [self addSubview:self.img];
    [self addSubview:self.name];
    [self addSubview:self.detail];
}

- (UILabel *)line
{
    if (!_line)
    {
        _line = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 5)];
    }
    return _line;
}

- (UILabel *)name
{
    if (!_name)
    {
        _name = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.line.frame) + 10, kScreenWidth / 3.0, 20)];
        _name.adjustsFontSizeToFitWidth = YES;
        _name.font = [UIFont systemFontOfSize:14];
        _name.textAlignment = NSTextAlignmentCenter;
    }
    return _name;
}

- (UILabel *)detail
{
    if (!_detail)
    {
        _detail = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.name.frame) + 5, kScreenWidth / 3.0, 20)];
        _detail.adjustsFontSizeToFitWidth = YES;
        _detail.font = [UIFont systemFontOfSize:14];
        _detail.textAlignment = NSTextAlignmentCenter;
        _detail.textColor = [UIColor grayColor];
    }
    return _detail;
}

- (UIImageView *)img
{
    if (!_img)
    {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.detail.frame), kScreenWidth / 3.0, 90)];
        _img.contentMode = UIViewContentModeCenter;
        _img.layer.masksToBounds = YES;
    }
    return _img;
}


@end
